import { listMediationBase } from '@/api/deal/mediation/mediationBase'
import { listMediationTeam } from '@/api/deal/mediation/mediationTeam/mediationTeam'

const mediation = {
  state: {
    mediationList: [],
    mediationTeamList: []
  },

  mutations: {
    SET_MEDIATION_LIST: (state, data) => {
      state.mediationList = data
    },
    SET_TEAM_LIST: (state, data) => {
      state.mediationTeamList = data
    }
  },

  actions: {
    getMediationList({ commit }) {
      listMediationBase({}).then(res => {
        commit('SET_MEDIATION_LIST', res.rows)
      })
    },
    getMediationTeamList({ commit }) {
      listMediationTeam({}).then(res => {
        commit('SET_TEAM_LIST', res.rows)
      })
    }
  }
}

export default mediation
